import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		 while(true) 
	        { int i,count=0; 
	          String S=input.next(); 
	         for(i=0;i<S.length();i++)
	          {
	        	  if(S.charAt(i)=='-') i++;
	        	  if(S.charAt(i)=='.') i++;
	        	  count=count+S.charAt(i)-'0';
	          }
	           
	            System.out.println(count);
	        }
	       
	        }

}
